package com.offroader.core;

import android.app.Application;

import com.offroader.R;
import com.offroader.utils.PhoneUtils;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.bugly.crashreport.CrashReport.UserStrategy;
import com.umeng.analytics.MobclickAgent;

public class OffRoaderApp extends Application {
	private static Application instance;

	@Override
	public void onCreate() {
		super.onCreate();

		instance = this;

		//友盟
		MobclickAgent.openActivityDurationTrack(false);//禁止默认的页面统计方式，这样将不会再自动统计Activity页面访问
		MobclickAgent.setCatchUncaughtExceptions(false);//关闭友盟导演捕获

		//bugly
		UserStrategy strategy = new UserStrategy(this);
		strategy.setAppChannel(getString(R.string.channel));//设置渠道
		strategy.setAppVersion(PhoneUtils.getAppVersionName(this));//App的版本
		CrashReport.initCrashReport(this, getString(R.string.bugly_app_id), false, strategy);

	}

	public static Application getInstance() {
		return instance;
	}

}
